import pymysql

conn = pymysql.connect(host='192.168.196.128', db='wa_test', user='root', passwd='123456')
cursor = conn.cursor()
sqls = ["delete from info where id=(select id from users where username='test06')",
        "delete from users where username='test06'"]
for sql in sqls:
    cursor.execute(sql)
conn.commit()
conn.close()

import requests

url = 'http://192.168.196.128/apitest/signup/'
args = {'username': 'test06', 'password': '123456', 'confirm': '123456', 'name': '测试六'}
res = requests.post(url, json=args)
print(res.text)

# actual = res.text
# expect = '注册成功'
# if expect in actual:
#     print('响应结果对比成功')
# else:
#     print(f'响应结果对比失败==预期：{expect}==实际：{actual}')

actual = res.json()
expect = {'Status': 1000, 'Result': 'Success', 'Message': '注册成功'}
if expect == actual:
    print('响应结果对比成功')
else:
    print(f'响应结果对比失败==预期：{expect}==实际：{actual}')
